package com.geektime.congestion.wallet;

import com.geektime.congestion.wallet.dao.VirtualWalletDao;
import com.geektime.congestion.wallet.domain.VirtualWallet;
import com.geektime.congestion.wallet.service.VirtualWalletServiceImpl;

import java.math.BigDecimal;

public class WalletMain {

    public static void main(String[] args) {

        VirtualWalletServiceImpl service = new VirtualWalletServiceImpl();
        service.add("1", new BigDecimal("100"));
        service.add("2", new BigDecimal("100"));
        service.add("3", new BigDecimal("100"));

        service.transfer("1", "2", new BigDecimal("10"));
        service.transfer("1", "3", new BigDecimal("10"));
        service.transfer("2", "3", new BigDecimal("10"));

        VirtualWalletDao dao = new VirtualWalletDao();
        for (VirtualWallet wallet : dao.findAll()) {
            System.out.println(wallet);
        }

    }

}
